<?php
/**
 * PHP AXIOM
 *
 * @license LGPL
 * @author Benjamin DELESPIERRE <benjamin.delespierre@gmail.com>
 * @category libAxiom
 * @package helper
 * $Date: 2011-07-27 16:44:09 +0000 (Wed, 27 Jul 2011) $
 * $Id: TableDataHelper.class.php 46 2011-07-27 16:44:09Z TchernoBen@gmail.com $
 */

/**
 * Table Data Helper Class
 *
 * @author Delespierre
 * @version $Rev: 46 $
 * @subpackage TableDataHelper
 */
class TableDataHelper extends BaseHelper {
    
    /**
     * Default constructor.
     *
     * Type parameter can be either 'data' or 'head'
     *
     * @param sring $value
     * @param string $type
     */
    public function __construct ($value = null, $type = 'data') {
        switch (strtolower($type)) {
            case 'th':
            case 'head':
                parent::__construct('th', array(), $value);
                break;
            
            case 'td':
            case 'data':
            default:
                parent::__construct('td', array(), $value);
                break;
        }
    }
    
    /**
     * Constructor static alias
     * @param string $value
     * @param string $type
     * @return TableDataHelper
     */
    public static function export ($value = null, $type = 'data') {
        return new self ($value, $type);
    }
}